package com.example.hcbmsm.controller;

import com.example.hcbmsm.service.InboundService;
import com.example.hcbmsm.service.OutboundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Xinghm
 * @version 1.0
 * @since 2024/11/5 20:25
 */
@RestController
@CrossOrigin
@RequestMapping("/bound")
public class BoundController {
    @Autowired
    private InboundService inboundService;
    @Autowired
    private OutboundService outboundService;

    @GetMapping("/list")
    public Map list(Long type, int page, int limit) {
        if (type == 1) {
            return inboundService.list(page, limit);
        } else {
            return outboundService.list(page, limit);
        }
    }
}
